function CheckAd(chk) {
    for (var i = 0; i < document.aspnetForm.elements.length; i++) {
        var e = document.aspnetForm.elements[i];
        if (e.type == "checkbox") {
            e.checked = chk.checked;
        }
    }
}